This forum is closed to new posts and
responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:
~Patti Chufoolit 19.Dec.03 06:20 AM a Web browser Applications DevelopmentAll ReleasesWindows XP
Below is some code that doesnt seem to want to totally work.
I can connect to my DSN.
But my QRY and my RESULT wont recognize the connection. I am trying to connect to an EXCEL spreadsheet. This is all client side.
I need to be able to loop thru all spreadsheet rows and pick out some data.
Any ideas?
Thanks,
Mike.
Dim con As New ODBCConnection
Dim qry As New ODBCQuery
Dim result As New ODBCResultSet
Dim msg As String
con.ConnectTo("reesa") ' reesa is a system DSN defined in the windows control panel ODBC driver.
If Not con.IsConnected Then
Messagebox "Could not connect to " & dsn,,"Error"
Exit Sub
End If
qry.QueryExecuteTimeOut = 10
qry.Connection = con
result.Query = qry
qry.SQL = "SELECT * FROM reesa"
result.Execute
msg = "Rows:" & Chr(10)
If result.IsResultSetAvailable Then
Do
result.NextRow
firstName = result.GetValue("F2",firstName)
lastName = result.GetValue("F5", lastName)
msg = msg & Chr(10) & firstName & " " & lastName
Loop Until result.IsEndOfData
Messagebox msg,, "Row Data"
result.Close(DB_CLOSE)
Else
Messagebox "Cannot get result set for STUDENTS"
Exit Sub
End If